package ua.kyivenergo.cableLines.search;

import ua.kyivenergo.cableLines.data.GenericObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Alex Kebkalo (kebka@mail.ru) on 22.04.14.
 */
public class ResultsList {
    List<SearchResult> searchResults;

    public ResultsList() {
        searchResults = new ArrayList<>();
    }

    public void addResult(GenericObject result, double relevance) {
        searchResults.add(new SearchResult(result, relevance));
    }

    public List<GenericObject> getResults() {
        List<GenericObject> results = new ArrayList<>();
        for (SearchResult searchResult : searchResults) {
            results.add(searchResult.result);
        }
        return results;
    }

}
